@import './theme/default.less';

.zent-radio-group {
  display: inline-block;
  font-size: 12px;
}

.zent-radio-wrap {
  display: inline-block;
  cursor: pointer;
  font-weight: 400;
  font-size: 12px;
  line-height: 14px;
  margin: 0;
  padding: 0;
  margin-right: 15px;
  vertical-align: middle;

  &.zent-radio-disabled {
    cursor: not-allowed;
  }

  &:last-child {
    margin-right: 0;
  }
}

.zent-radio {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  outline: none;
  vertical-align: middle;
  margin: 0;
  padding: 0;

  & > input {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    cursor: pointer;
  }

  & + span {
    margin-left: 5px;
    margin-right: 5px;
    vertical-align: middle;
    line-height: 14px;
  }
}

.zent-radio-inner {
  position: relative;
  top: 0;
  left: 0;
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 7px;
  border: 1px solid @theme-stroke-5;
  background: @theme-stroke-10;
  box-sizing: border-box;
  vertical-align: middle;
  transition: all 0.3s;

  &::after {
    position: absolute;
    display: block;
    content: ' ';
    top: 4px;
    left: 4px;
    width: 4px;
    height: 4px;
    border-radius: 2px;
    background: @theme-stroke-10;
    transform: scale(0);
    transition: all 0.12s ease-in-out;
  }
}

.zent-radio-checked {
  & > .zent-radio {
    & > .zent-radio-inner {
      border-color: @theme-primary-1;
      background: @theme-primary-2;

      &::after {
        transform: scale(1);
      }
    }
  }
}

.zent-radio-disabled {
  & > .zent-radio {
    & > .zent-radio-inner {
      background-color: @theme-stroke-9;
      border-color: @theme-stroke-7;
    }

    & > input[type="radio"] {
      cursor: not-allowed;
    }
  }

  &.zent-radio-checked > .zent-radio {
    & > .zent-radio-inner {
      background-color: @theme-stroke-7;
      border-color: @theme-stroke-7;
    }
  }
}
